package cn.hotel.mapper;

import cn.hotel.entity.Order;
import com.sun.org.apache.xpath.internal.operations.Or;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
public interface OrderMapper {

    public List<Order> queryOrdersByUserId(@Param("userId") String userId);

    public int addOrder(Order order);

    public Order queryOrderById(@Param("orderId") Integer orderId);

    public int setOrderStatus(@Param("orderId") String orderId,@Param("status")String status);

    public int deleteOrder(@Param("orderId") Integer orderId);

    //获取所有的订单信息
    int getOrders();
    public Order queryOrderById(@Param("orderId") String orderId);

    public List<Order> allOrder(@Param("params")String params, @Param("status") Integer status);

    public int deleteByOrderId(@Param("orderId") Integer orderId);

    public int getOrderCount();

    public int updateOrder(Order order);

    public List<Order> getOrderByName(String name);

    public Order  getOrderByNameAndPhone(@Param("name") String name , @Param("phone") String phone);
}
